package com.example.chessbattleplatform.web.Sys_User.Pojo.dto;

import jakarta.validation.constraints.*;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

// 注册请求体
@Data
@AllArgsConstructor
@NoArgsConstructor
public class RegisterRequest {
    @NotBlank(message = "用户名不能为空且不能只包含空格")
    @Size(min = 2, max = 20, message = "用户名长度需在2-20字符之间")
    private String name;

    @Pattern(regexp = "^(?=.*[A-Za-z])(?=.*\\d)[A-Za-z\\d]{8,}$",
            message = "密码必须至少8位，包含字母和数字")
    @Size(min = 8, max = 20, message = "密码长度需在8-20字符之间")
    private String password;

    @Email(message = "邮箱格式不正确")
    private String email;

}
